const SYSTEM_INFO = uni.getSystemInfoSync();
const SYSTEM = SYSTEM_INFO.platform;
const SYSTEM_VERSION = SYSTEM_INFO.version;
const SYSTEM_NAME = SYSTEM_INFO.system;
const SYSTEM_PIXEL_RATIO = SYSTEM_INFO.pixelRatio;
const SYSTEM_WINDOW_WIDTH = SYSTEM_INFO.windowWidth; // 可使用窗口宽度
const SYSTEM_WINDOW_HEIGHT = SYSTEM_INFO.windowHeight; // 可使用窗口高度

// const SYSTEM_MODEL = SYSTEM_INFO.model;
// const SYSTEM_BRAND = SYSTEM_INFO.brand;
// const SYSTEM_LANGUAGE = SYSTEM_INFO.language;
// const SYSTEM_SAFE_AREA = SYSTEM_INFO.safeArea; // 在竖屏模式下为安全区域
// const SYSTEM_INSETS = SYSTEM_INFO.insets; // 安全区域
// const SYSTEM_SCREEN_WIDTH = SYSTEM_INFO.screenWidth; // 屏幕宽度
// const SYSTEM_SCREEN_HEIGHT = SYSTEM_INFO.screenHeight; // 屏幕高度


const SYSTEM_STATUS_BAR_HEIGHT = SYSTEM_INFO.statusBarHeight; // 状态栏高度
export const getStatusBarHeight = () => SYSTEM_STATUS_BAR_HEIGHT || 0;

export const getTitleBarHeight = () => {
  if (uni.getMenuButtonBoundingClientRect) {
    const {
      top,
      height
    } = uni.getMenuButtonBoundingClientRect();
    return height + (top - getStatusBarHeight)
  }
  return 44;
};

export const getNavBarHeight = () => getTitleBarHeight() + getStatusBarHeight();
